function foo() {
  return true;
  console.log("done");
}

function bar() {
  throw new Error("Oops!");
  console.log("done");
}

while(value) {
  break;
  console.log("done");
}

throw new Error("Oops!");
console.log("done");

function baz() {
  if (Math.random() < 0.5) {
    return;
  } else {
    throw new Error();
  }
  console.log("done");
}

for (;;) {}
console.log("done");

// github
function foo() { return x; var x = 1; }
function foo() { return x; var x, y = 1; }
function foo() { return; x = 1; }
function foo() { throw error; x = 1; }
function foo() { switch (foo) { case 1: return; x = 1; } }
function foo() { switch (foo) { case 1: throw e; x = 1; } }
while (true) { continue; var x = 1; }
while (true) { break; x = 1; }
while (true) { continue; x = 1; }
while (true) { switch (foo) { case 1: break; x = 1; } }
while (true) { switch (foo) { case 1: continue; x = 1; } }
var x = 1; throw 'uh oh'; var y = 2;
function foo() { var x = 1; if (x) { return; } else { throw e; } x = 2; }
function foo() { var x = 1; if (x) return; else throw -1; x = 2; }
function foo() { var x = 1; try { return; } finally {} x = 2; }
function foo() { var x = 1; try { } finally { return; } x = 2; }
function foo() { var x = 1; do { return; } while (x); x = 2; }
function foo() { var x = 1; while (x) { if (x) break; else continue; x = 2; } }
function foo() { var x = 1; for (;;) { if (x) continue; } x = 2; }
function foo() { var x = 1; while (true) { } x = 2; }
const arrow_direction = arrow => {  switch (arrow) { default: throw new Error();  }; g() }

function foo() {
  return;

  a();  // ← ERROR: Unreachable code. (no-unreachable)

  b()   // ↑ ';' token is included in the unreachable code, so this statement will be merged.
  // comment
  c();  // ↑ ')' token is included in the unreachable code, so this statement will be merged.
};

function foo() {
  return;

  a();

  if (b()) {
    c()
  } else {
    d()
  }
};

function foo() {
  if (a) {
    return
    b();
    c();
  } else {
    throw err
    d();
  }
}

function foo() {
  if (a) {
    return
    b();
    c();
  } else {
    throw err
    d();
  }
  e();
};

function* foo() {
  try {
    return;
  } catch (err) {
    return err;
  }
};

function foo() {
  try {
    return;
  } catch (err) {
    return err;
  }
}

function foo() {
  try {
    return;
    let a = 1;
  } catch (err) {
    return err;
  }
};

class C extends B { foo; constructor() {} }
class C extends B { foo = unreachable + code; constructor() {} }
class C extends B { foo; bar; constructor() {} }
class C extends B { foo; constructor() {} bar; }
class A extends B { foo; constructor() {} bar; }
class B extends A { x; constructor() { class C extends D { [super().x]; constructor() {} } } }
class B extends A { x; constructor() { class C extends super().x { y; constructor() {} } } }
class B extends A { x; static y; z; static q; constructor() {} }